<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <link rel="stylesheet" type="text/css" th:href="@{/css/controBook1.css}" />
  <link rel="stylesheet" type="text/css" th:href="@{/css/detailButton.css}" />
</head>
<body>
<div class="header">
  <h1>书列表</h1>
  <a th:href="@{/goToAddBook}" class="add-book-link">增加书</a>
    <a th:href="@{/goToHome}" class="add-book-link">首页</a>
</div>
<table id="book-table">
  <thead>
  <tr>
    <th>书名</th>
    <th>作者</th>
    <th>封面</th>
    <th>操作</th>
    <th>详情页</th>
  </tr>
  </thead>
  <tbody>
  <tr th:each="books: ${books}">
    <th th:text="${books.book_name}"></th>
    <th th:text="${books.author}"></th>
    <th>
        <span th:if="${books.book_cover}">
          <img th:src="${books.bookCoverJpg}"
         alt="Book Cover" width="100" height="150" /></span>
    </th>
    <th>
        <form action="/deleteBookById" method="post" class="delete-form">
          <button type="submit" name="book_id" th:value="${books.book_id}" class="delete-btn">Delete</button>
        </form>


        <form action="/goToUpdateBookById" method="post" class="update-form">
          <button type="submit" name="book_id" th:value="${books.book_id}" class="update-btn">Update</button>
        </form>
    </th>
    <th>
<!--      <form action="/bookDetail" method="get">-->
      <form action="http://localhost:8081/findBookidAdmin" method="get">
        <button type="submit" name="book_id" th:value="${books.book_id}" class="btn">详情页</button>
      </form>
    </th>
  </tr>
</table>

</body>
</html>